package com.winit.schedule.job.tracker.channel;

import io.netty.channel.Channel;

public class ChannelWrapper {

    private Channel channel;
    // 节点的唯一标识
    private String  taskTrackerUuid;

    public ChannelWrapper(Channel channel, String taskTrackerUuid){
        this.channel = channel;
        this.taskTrackerUuid = taskTrackerUuid;
    }

    public Channel getChannel() {
        return channel;
    }

    public void setChannel(Channel channel) {
        this.channel = channel;
    }

    public String getTaskTrackerUuid() {
        return taskTrackerUuid;
    }

    public void setTaskTrackerUuid(String taskTrackerUuid) {
        this.taskTrackerUuid = taskTrackerUuid;
    }

    public boolean isClosed() {
        return !channel.isOpen();
    }

    @Override
    public String toString() {
        return "ChannelWrapper{" + "channel=" + channel + ", taskTrackerUuid=" + taskTrackerUuid + '}';
    }
}
